<?php
include_once $_SERVER["DOCUMENT_ROOT"].'/outils/logger/KLogger.php';
include_once $_SERVER["DOCUMENT_ROOT"].'/outils/parameters/ParameterGetter.php';
include_once($_SERVER["DOCUMENT_ROOT"].'/outils/properties/PropertiesLoader.php');
PropertiesLoader::loadProperties($_SERVER["DOCUMENT_ROOT"].'/properties.ini');


class Logger {	
	static $logger;
	public static function getLogger() {
		if (self::$logger == null) {
			//self::$logger = ParameterGetter::getSessionParameter("logger", false);
			if (self::$logger == null) {
				$file = $_SERVER["DOCUMENT_ROOT"].PropertiesLoader::getProperty("logger.repertoire");
				$niveau = PropertiesLoader::getProperty("logger.niveau");
				
				self::$logger=KLogger::instance($file, $niveau);
				ParameterGetter::setSessionParameter("logger", self::$logger);
			}
		}
		return self::$logger;
	}
}

?>